import { baseUrl } from './config.js'


const listIds = ['3','0','2','1']

export function topList(){
	return new Promise(function(reslove,reject){
		
		uni.request({
			url:`${baseUrl}/toplist/detail`,
			method: 'GET',
			data: {},
			success: res => {
				let result = res.data.list;
				result.length = 4;
				listIds.forEach((item,i) => {
					result[i].listId = item
				})
				reslove(result);
			},
			fail : () => {},
			complete: () => {}
		})
	})
}


export function list(id){
	return uni.request({
		url:`${baseUrl}/playlist/detail?id=${id}`,
		method:'GET'
	})
}